<?php
/**
 * Created by PhpStorm.
 * User: xuewl
 * Date: 2017/12/21
 * Time: 14:59
 */

namespace app\user\model;
use app\common\library\Model;

class UserPointLog extends Model
{
    protected $append = [
        'type_name',
    ];

    public function getTypeNameAttr($value, $data) {
        $config = config('user.user_point_log_field_type');
        return $config[$data['type']];
    }

    public function userInfo() {
        return $this->hasOne("app\\user\\model\\user", 'id', 'uid');
    }
}